#pragma once
#include "DataBase.h"
#include <string>
#include <iostream>
#include <mysql.h>
#ifdef _DEBUG
#pragma comment(lib,"libmysql.lib")
#else
#pragma comment(lib,"libmysql.lib")
#endif

class LockclipMySQL {

public:
	MYSQL connection;
	MYSQL_RES* result = NULL;
	MYSQL_ROW row;
	SensorInfo gang_jin_sensor_info, suo_cao_sensor_info, zhui_mian_sensor_info;
	AlarmEventRecord gang_jin_alarm_event_record, suo_cao_alarm_event_record, zhui_mian_alarm_event_record;
	AlarmTip gang_jin_alarm_tip, suo_cao_alarm_tip, zhui_mian_alarm_tip;

	char localhost[BUF_SQL_LEN] = "127.0.0.1";
	char user[BUF_SQL_LEN] = "root";
	char password[BUF_SQL_LEN] = "123456";
	char gan_jin_detector[BUF_SQL_LEN] = "gan_jin_detector";
	char suo_cao_detector[BUF_SQL_LEN] = "suo_cao_detector";
	char zui_mian_detector[BUF_SQL_LEN] = "zui_mian_detector";
	short int port = 3306;
	bool SQL_OpenDataBase(char database[]);
};

